﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageLayout.master" AutoEventWireup="true" CodeBehind="frmLopMonhoc.aspx.cs" Inherits="BVVD_Website.ql_hoc_tap.frmLopMonhoc" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        div.RadListBox .rlbGroup {
            overflow: auto;
        }

        .rsbHeader ul,
        .rsbListItem ul {
            margin: 0;
            padding: 0;
            width: 100%;
            display: inline-block;
            list-style-type: none;
        }

        .rsbHeader ul {
            padding-left: 5px;
        }

        .col1,
        .col2,
        .col3 {
            margin: 0;
            padding: 0 5px 0 0;
            width: 110px;
            line-height: 14px;
            float: left;
        }


        html .rsbSlide,
        html .rsbDropDownSlide {
            z-index: 90002;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="5">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel runat="server" ID="pnlAjax" LoadingPanelID="RadAjaxLoadingPanel1">
        <div id="Div1" class="mpBottomContent" runat="server">
            <asp:Label runat="server" ID="lblMenu" Style="margin: 0 auto 0 auto; font-family: 'Microsoft Sans Serif'; font-size: larger; color: forestgreen" Text="DANH SÁCH LỚP HỌC - MÔN HỌC"></asp:Label>

            <table style="margin: 0 auto 0 auto; border: 5px thin red; width: 90% !important; padding: 5px 5px 5px 5px">
                <caption style="float: left">
                    <telerik:RadDropDownList DefaultMessage="Chọn lớp" DropDownHeight="200" Skin="Metro"  OnSelectedIndexChanged="ddlLOPHOC_SelectedIndexChanged" AutoPostBack="true" runat="server" ID="ddlLOPHOC"></telerik:RadDropDownList>

                </caption>
                <tr>
                    <td>
                        <telerik:RadGrid ID="grvLopMonhoc" Skin="Hay" AllowFilteringByColumn="true" MasterTableView-NoMasterRecordsText="Không tìm thấy bản ghi nào" MasterTableView-ShowHeadersWhenNoRecords="true" ClientSettings-ColumnsReorderMethod="Reorder" ClientSettings-AllowColumnsReorder="true" ClientSettings-Animation-AllowColumnReorderAnimation="true" ClientSettings-Animation-ColumnReorderAnimationDuration="300" PageSize="15" AllowSorting="true"  AutoGenerateColumns="false" AllowPaging="true" ClientSettings-AllowDragToGroup="true" runat="server" OnNeedDataSource="grvLopMonhoc_NeedDataSource" OnItemDataBound="grvLopMonhoc_ItemDataBound" OnDeleteCommand="grvLopMonhoc_DeleteCommand" OnInsertCommand="grvLopMonhoc_InsertCommand">

                            <PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="RadComboBox" Wrap="true" AlwaysVisible="true" />

                            <MasterTableView CommandItemDisplay="Top" EnableNoRecordsTemplate="true" CssClass="MasterClass" ShowFooter="true" EditMode="PopUp" Summary="SUMMARY" ShowHeadersWhenNoRecords="true"
                                DataKeyNames="RECID">
                                <CommandItemSettings AddNewRecordText="Thêm mới" RefreshText="Làm mới danh sách" ExportToPdfText="Xuất file dạng PDF" ShowExportToPdfButton="true"></CommandItemSettings>
                                <CommandItemSettings ExportToExcelText="XUất file dạng Excel" ShowExportToExcelButton="true"></CommandItemSettings>

                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
                                <NoRecordsTemplate>
                                    <div>
                                        Không có bản ghi nào
                                    </div>
                                </NoRecordsTemplate>
                                <Columns>

                                    <telerik:GridBoundColumn UniqueName="RECID" EditFormColumnIndex="1" Display="false" ReadOnly="true" HeaderText="" DataField="RECID">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text=""></ModelErrorMessage>
                                        </ColumnValidationSettings>
                                        <HeaderStyle ForeColor="Silver" Width="20px"></HeaderStyle>
                                        <ItemStyle ForeColor="Gray"></ItemStyle>
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn UniqueName="MALH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" Display="false" HeaderStyle-Width="20%" HeaderText="Mã lớp" DataField="MALH">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text=""></ModelErrorMessage>
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn UniqueName="TENLH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Lớp" DataField="TENLH">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text=""></ModelErrorMessage>
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn UniqueName="MAMH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã môn học" DataField="MAMH">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text=""></ModelErrorMessage>
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn UniqueName="TENMH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Môn học" DataField="TENMH">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text=""></ModelErrorMessage>
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>

                                    <telerik:GridTemplateColumn UniqueName="TRANGTHAI" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Trạng thái" DataField="TRANGTHAI">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblTRANGTHAI" Text='<%# DataBinder.Eval(Container.DataItem,"TRANGTHAI").ToString().Equals("1")?"ACTIVE":"CLOSED" %>'>                                            
                                            </asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>


                                    <telerik:GridBoundColumn UniqueName="GHICHU" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" Display="true" HeaderStyle-Width="30%" HeaderText="Ghi chú" DataField="GHICHU">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text=""></ModelErrorMessage>
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>

                                    <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" HeaderText="Xóa" ItemStyle-Width="60" HeaderStyle-Width="60" ConfirmDialogType="RadWindow" ConfirmTextFormatString="Bạn chắc chắn muốn xóa bản ghi : \n\n \t Mã lớp học : {0} <br> \t Mã môn học :  {1} \n " ConfirmTextFields="MALH, MAMH" ConfirmTitle="Xác nhận xóa" ConfirmText="Xóa, Hủy" Text="Xóa" UniqueName="btnDelete">
                                    </telerik:GridButtonColumn>
                                </Columns>
                                <EditFormSettings EditFormType="Template" PopUpSettings-ShowCaptionInEditForm="true" PopUpSettings-Width="660" PopUpSettings-ScrollBars="Auto" PopUpSettings-ZIndex="7000" InsertCaption="Thêm mới học viên vào lớp " PopUpSettings-Modal="true" CaptionFormatString="Mã lớp học {0}" CaptionDataField="MALH">
                                    <FormTemplate>
                                        <div id="rfd-demo-zone" style="border: solid; border-color: whitesmoke; border-width: 5px; padding: 6px 6px 6px 6px;">
                                            <table width="600"  border="0" cellspacing="10" cellpadding="10" style="text-align:left">
                                                <caption style="color: green; font-weight: bold; font-size:14px">
                                                    CHỌN MÔN HỌC CHO LỚP
                                                </caption>
                                                <tr>
                                                    <td style="width: 300px">
                                                        <asp:Label runat="server" ID="lblTEXT"></asp:Label>
                                                    </td>
                                                    <td></td>
                                                    <td></td>
                                                </tr>
                                                <tr>
                                                    <td>Danh sách môn học</td>
                                                    <td></td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblMAMH"></asp:Label>                                                        
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <telerik:RadSearchBox ID="RadSearchBox1" DataSourceID="LinqDataSource1" DataTextField="NAME" Filter="Contains" OnSearch="RadSearchBox1_Search" EmptyMessage="Nhập tên/mã môn học để tìm kiếm" Width="250" CssClass="upAll" Skin="Hay" MinFilterLength="1" EnableAutoComplete="true" ShowSearchButton="true" runat="server"
                                                        MaxResultCount="20" DataValueField="MAMH" DataKeyNames="MAMH,TENMH">
                                                            <DropDownSettings Height="300">
                                                                <HeaderTemplate>
                                                                    <ul>
                                                                        <li class="col1">Mã môn học</li>
                                                                        <li class="col2">Tên môn học</li>
                                                                    </ul>
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <ul>
                                                                        <li class="col1">
                                                                            <%# DataBinder.Eval(Container.DataItem, "MAMH") %>
                                                                        </li>
                                                                        <li class="col2">
                                                                            <%# DataBinder.Eval(Container.DataItem, "TENMH") %>                                                                    
                                                                        </li>
                                                                    </ul>
                                                                </ItemTemplate>
                                                            </DropDownSettings>
                                                        </telerik:RadSearchBox>
                                                    </td>
                                                    <td></td>
                                                    <td></td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <telerik:RadListBox runat="server" Style="text-align: left !important" ButtonSettings-HorizontalAlign="Center" ButtonSettings-VerticalAlign="Middle" OnTransferring="lboxMONHOC_Transferring" TransferMode="Move" Height="200" Skin="Telerik" Width="300" Sort="Ascending" AllowTransferDuplicates="false" ID="lboxMONHOC" AllowTransfer="true" TransferToID="lboxTOLOP">
                                                        </telerik:RadListBox>
                                                    </td>
                                                    <td></td>
                                                    <td>
                                                        <telerik:RadListBox Height="200" Style="text-align: left !important" Skin="Telerik" Width="280" runat="server" ID="lboxTOLOP">
                                                        </telerik:RadListBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="3" style="text-align:center">
                                                        <asp:LinkButton ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Thêm mới" : "Cập nhật" %>'
                                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:LinkButton>&nbsp;
                                                        <asp:LinkButton ID="btnCancel" Text="Hủy" runat="server" CausesValidation="False"
                                                            CommandName="Cancel"></asp:LinkButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </FormTemplate>
                                </EditFormSettings>
                            </MasterTableView>
                            <ClientSettings>
                                <ClientEvents OnPopUpShowing="PopUpShowing" />
                                <%--<ClientEvents OnRowDblClick="RowDblClick" />--%>
                                <Selecting AllowRowSelect="true" />
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="500" />

                            </ClientSettings>
                            <ExportSettings Excel-Format="Biff" Pdf-DefaultFontFamily="Arial" FileName="Mydata" IgnorePaging="false" Excel-AutoFitImages="true" Excel-FileExtension="xls" HideStructureColumns="true"></ExportSettings>
                        </telerik:RadGrid>
                    </td>
                </tr>
            </table>
        </div>

        <telerik:RadNotification ID="rnAlert" Width="300" runat="server" ContentScrolling="Auto" Position="TopRight" EnableRoundedCorners="true"
            EnableShadow="true" Skin="Metro" Overlay="true" Animation="Fade" AnimationDuration="1000" Title="Thông báo">
        </telerik:RadNotification>
        <asp:LinqDataSource ID="LinqDataSource1" OnSelecting="LinqDataSource1_Selecting" runat="server" ContextTypeName="Business.BVVDDataContext" EntityTypeName="" TableName="LST_MONHOCs"></asp:LinqDataSource>
    </telerik:RadAjaxPanel>
</asp:Content>
